package com.personal.gateway.custom.customEnum.flinkCommandEnum;

import com.personal.gateway.flinkAllCommand.configurationOption.ConfigurationOption;
import com.personal.gateway.flinkAllCommand.configurationOption.configurationType.ConfigurationTypeEnumInterface;

import javax.annotation.Nonnull;

/**
 * @author BigHead
 * @date 2022/1/7 10:42
 * @description FlinkVersionEnum
 */
public enum FlinkVersionEnum implements ConfigurationTypeEnumInterface {

    /**
     * 空版本，无作用
     */
    NULL_VERSION("");

    public final static Class<Enum<? extends ConfigurationTypeEnumInterface>> FLINK_VERSION_TYPE_CLASS = (Class<Enum<? extends ConfigurationTypeEnumInterface>>) (Class<?>) FlinkVersionEnum.class;

    private final String flinkVersionPath;

    FlinkVersionEnum(String flinkVersionPath) {
        this.flinkVersionPath = flinkVersionPath;
    }

    @Override
    public String getShowValue() {
        return name();
    }

    @Override
    public String getSelectValue() {
        return flinkVersionPath;
    }

    @Override
    public boolean checkExist(@Nonnull String... values) {
        if (values.length == 1){
            return flinkVersionPath.equals(values[0]);
        }
        return false;
    }

    @Override
    public boolean checkExist(ConfigurationOption<?, ?> configurationOption, @Nonnull String... values) {
        return false;
    }

    @Override
    public boolean checkExampleValue(ConfigurationOption<?, ?> configurationOption) {
        return false;
    }
}
